<template>
    <div class="brother">
        <h1>brother1 兄弟组件一</h1>

        <button @click="sendMsg">将至传给兄弟2</button>
    </div>
</template>

<script>
    import eventBus from "@/eventBus";
    export default {
        name: "Brother1",
        data(){
            return{
                msg:"hello vue!!!"
            }
        },
        methods:{
            //数据发送方
            sendMsg(){
                eventBus.$emit('share',this.msg)
            }
        }
    }
</script>

<style scoped>

</style>